﻿using Century.Web.UI.MVC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace WebUI
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.Ignore("{*allaspx}", new { allaspx = @".*\.aspx(/.*)?" });
            routes.Ignore("{*allcss}", new { allcss = @".*\.css(/.*)?" });
            routes.Ignore("{*alljpg}", new { alljpg = @".*\.jpg(/.*)?" });
            routes.Ignore("{*alljs}", new { alljs = @".*\.js(/.*)?" });
            routes.Ignore("{*allico}", new { allico = @".*\.ico(/.*)?" });
            routes.Ignore("{*allpng}", new { allpng = @".*\.png(/.*)?" });
            routes.Ignore("{*allgif}", new { allgif = @".*\.gif(/.*)?" });
            routes.Ignore("{*allswf}", new { allswf = @".*\.swf(/.*)?" });
            routes.IgnoreRoute("favicon.ico");
            routes.IgnoreRoute(
          "{*staticfile}",
          new { staticfile = @".*\.(jpg|gif|jpeg|png|js|css|htm|html|htc)$" });

            routes.MapRoute(
             "Default", // Route name
             "{stPath}/{pgName}/{id}", // URL with parameters
             new { controller = "Home", action = "Index", pgName = "", id = UrlParameter.Optional }
              );

            ControllerBuilder.Current.SetControllerFactory(new SitePathHandlerController());

        }

    }
}